package cn.itrip.auth.service;

import org.springframework.mail.MailSender;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @Author: jxm
 * @Description:
 * @Date: 2020/3/11 21:19
 * @Version: 1.0
 */
@Service("mailService")
public class MailServiceImpl implements MailService {

    @Resource
    private SimpleMailMessage mailMessage;
    @Resource
    private MailSender mailSender;

    @Override
    public void sendActivationCode(String mailTo, String activationCode) throws Exception {
        mailMessage.setTo(mailTo);
        mailMessage.setText("您的i激活码是："+activationCode);
        mailSender.send(mailMessage);

    }
}
